Ext.define('DutyList.calendar.view.UsersGrid', {
    extend: 'Ext.grid.Panel',
    alias: 'widget.usersgrid',
    initComponent : function() {
        //console.log(this.store);
        /*this.store.load({
            scope: this,
            callback: function(records,success,operation){
                 console.log(records,success,operation);
            }
        });*/
        var me = this;
        var  groupingFeature = Ext.create('Ext.grid.feature.Grouping',{
                groupHeaderTpl: 'Group: {name} ({rows.length})',
                hideGroupedHeader:false,
                enableGroupingMenu:false,
                startCollapsed: false ,
                showEmptyGroups:true,
                emptyIndicatorField:'cnt',
                emptyGroupHeaderTpl:'Group: {name} (0)',
                emptyGroupBodyTpl:'No engeneers'
        });
        Ext.apply(me,{
           // features: [groupingFeature],
            columns: [{
                text: 'Name',
                flex: 1,
                dataIndex: 'name'
            }]
        });
            this.callParent(arguments);
    },
    afterRender: function(){
        var cfg = {
            view: this,
            ddGroup: 'UserCalendarDD'
        };
        this.dragZone = new DutyList.calendar.dd.DragZonUserToCalendarPanel(this.el,cfg);
        //this.dropZone = new DutyList.calendar.dd.DropZonUserToCalendarPanel(this.el,cfg);
        this.callParent(arguments);
    },

    onInitDrag: function(){
        this.fireEvent('initdrag', this);
    }
});

